
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>logback中文网|第十章：JMX 配置器</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="logback中文网包含了logback中文文档，最新资讯，应用案例等。logback 继承自 log4j，它建立在有十年工业经验的日志系统之上。它比其它所有的日志系统更快并且更小，包含了许多独特并且有用的特性。"><meta name="keywords" content="logback中文文档, logback api文档, logback log4j,springboot logback,logback日志类型">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="11第十一章Joran.html" />
    
    
    <link rel="prev" href="09第九章日志隔离.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="./">
            
                <a href="./">
            
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="01第一章logback介绍.html">
            
                <a href="01第一章logback介绍.html">
            
                    
                    第一章：logback 介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="02第二章架构.html">
            
                <a href="02第二章架构.html">
            
                    
                    第二章：架构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="03第三章logback的配置.html">
            
                <a href="03第三章logback的配置.html">
            
                    
                    第三章：logback 的配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="04第四章Appenders.html">
            
                <a href="04第四章Appenders.html">
            
                    
                    第四章：Appenders
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="05第五章Encoder.html">
            
                <a href="05第五章Encoder.html">
            
                    
                    第五章：Encoder
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="06第六章Layouts.html">
            
                <a href="06第六章Layouts.html">
            
                    
                    第六章：Layouts
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="07第七章Filters.html">
            
                <a href="07第七章Filters.html">
            
                    
                    第七章：Filters
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="08第八章MDC.html">
            
                <a href="08第八章MDC.html">
            
                    
                    第八章：MDC
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="09第九章日志隔离.html">
            
                <a href="09第九章日志隔离.html">
            
                    
                    第九章：日志隔离
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.11" data-path="10第十章JMX配置器.html">
            
                <a href="10第十章JMX配置器.html">
            
                    
                    第十章：JMX 配置器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12" data-path="11第十一章Joran.html">
            
                <a href="11第十一章Joran.html">
            
                    
                    第十一章：Joran
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13" data-path="12第十二章Groovy配置.html">
            
                <a href="12第十二章Groovy配置.html">
            
                    
                    第十二章：Groovy 配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14" data-path="13第十三章从log4j迁移.html">
            
                <a href="13第十三章从log4j迁移.html">
            
                    
                    第十三章：从 log4j 迁移
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15" data-path="14第十四章Receivers.html">
            
                <a href="14第十四章Receivers.html">
            
                    
                    第十四章：Receivers
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.16" data-path="15第十五章使用SSL.html">
            
                <a href="15第十五章使用SSL.html">
            
                    
                    第十五章：使用 SSL
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >第十章：JMX 配置器</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <p>&#x987E;&#x540D;&#x601D;&#x4E49;&#xFF0C;<code>JMXConfigurator</code> &#x5141;&#x8BB8;&#x901A;&#x8FC7; JMX &#x6765;&#x914D;&#x7F6E; logback&#x3002;&#x7B80;&#x5355;&#x6765;&#x8BF4;&#x5C31;&#x662F;&#xFF0C;&#x5B83;&#x5141;&#x8BB8;&#x4F60;&#x4ECE;&#x9ED8;&#x8BA4;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#xFF0C;&#x6307;&#x5B9A;&#x7684;&#x6587;&#x4EF6;&#x6216;&#x8005; URL &#x91CD;&#x65B0;&#x914D;&#x7F6E; logback&#xFF0C;&#x5217;&#x51FA; logger &#x4EE5;&#x53CA;&#x4FEE;&#x6539; logger &#x7EA7;&#x522B;&#x3002;</p>
<h3 id="&#x4F7F;&#x7528;-jmx-&#x914D;&#x7F6E;&#x5668;">&#x4F7F;&#x7528; JMX &#x914D;&#x7F6E;&#x5668;</h3>
<p>&#x5982;&#x679C;&#x4F60;&#x7684;&#x8FD0;&#x884C;&#x5728; JDK 1.6 &#x6216;&#x8005;&#x66F4;&#x9AD8;&#x7684;&#x7248;&#x672C;&#xFF0C;&#x90A3;&#x4E48;&#x4F60;&#x4EC5;&#x4EC5;&#x9700;&#x8981;&#x5728;&#x547D;&#x4EE4;&#x884C;&#x8C03;&#x7528; <code>jconsole</code>&#xFF0C;&#x7136;&#x540E;&#x8FDE;&#x63A5;&#x5230;&#x4F60;&#x670D;&#x52A1;&#x5668;&#x4E0A;&#x7684; MBeanServer&#x3002;&#x5982;&#x679C;&#x4F60;&#x8FD0;&#x884C;&#x5728;&#x8001;&#x7248;&#x672C;&#x7684; JVM &#x4E0A;&#xFF0C;&#x90A3;&#x4E48;&#x4F60;&#x9700;&#x8981;&#x67E5;&#x770B;<a href="https://logback.qos.ch/manual/jmxConfig.html#jmxEnablingServer" target="_blank">&#x5728;&#x670D;&#x52A1;&#x4E0A;&#x4F7F;&#x7528; JMX</a>&#x3002;</p>
<p>&#x5728;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x4E2D;&#x5F00;&#x542F; <code>JMXConfigurator</code> &#x53EA;&#x9700;&#x8981;&#x4E00;&#x884C;&#x3002;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre><code class="lang-xml"><span class="hljs-tag">&lt;<span class="hljs-name">configuration</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">jmxConfigurator</span> /&gt;</span>

  <span class="hljs-tag">&lt;<span class="hljs-name">appender</span> <span class="hljs-attr">name</span>=<span class="hljs-string">&quot;console&quot;</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;ch.qos.logback.core.ConsoleAppender&quot;</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">layout</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;ch.qos.logback.classic.PatternLayout&quot;</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">Pattern</span>&gt;</span>%date [%thread] %-5level %logger{25} - %msg%n<span class="hljs-tag">&lt;/<span class="hljs-name">Pattern</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">layout</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">appender</span>&gt;</span>

  <span class="hljs-tag">&lt;<span class="hljs-name">root</span> <span class="hljs-attr">level</span>=<span class="hljs-string">&quot;debug&quot;</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">appender-ref</span> <span class="hljs-attr">ref</span>=<span class="hljs-string">&quot;console&quot;</span> /&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">root</span>&gt;</span>  
<span class="hljs-tag">&lt;/<span class="hljs-name">configuration</span>&gt;</span>
</code></pre>
<p>&#x5728;&#x4F60;&#x901A;&#x8FC7; <em>jconsole</em> &#x8FDE;&#x63A5;&#x5230;&#x670D;&#x52A1;&#x5668;&#x4E0A;&#x4E4B;&#x540E;&#xFF0C;&#x5728; MBeans &#x9762;&#x677F;&#x4E0A;&#xFF0C;&#x5728; &quot;ch.qos.logback.classic.jmx.Configurator&quot; &#x6587;&#x4EF6;&#x5939;&#x4E0B;&#x4F60;&#x53EF;&#x4EE5;&#x770B;&#x5230;&#x51E0;&#x4E2A;&#x9009;&#x9879;&#x3002;&#x5982;&#x4E0B;&#x56FE;&#x6240;&#x793A;&#xFF1A;</p>
<h3 id="&#x5728;-jconsole-&#x4E2D;&#x67E5;&#x770B;-jmxconfigurator-&#x7684;&#x622A;&#x56FE;">&#x5728; <code>jconsole</code> &#x4E2D;&#x67E5;&#x770B; <code>JMXConfigurator</code> &#x7684;&#x622A;&#x56FE;</h3>
<p><img src="images/jmxConfigurator.gif" alt=""></p>
<p>&#x6240;&#x4EE5;&#xFF0C;&#x4F60;&#x53EF;&#x4EE5;</p>
<ul>
<li>&#x4F7F;&#x7528;&#x9ED8;&#x8BA4;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x91CD;&#x65B0;&#x52A0;&#x8F7D; logback &#x7684;&#x914D;&#x7F6E;</li>
<li>&#x901A;&#x8FC7;&#x6307;&#x5B9A;&#x7684; URL &#x91CD;&#x65B0;&#x52A0;&#x8F7D;&#x914D;&#x7F6E;</li>
<li>&#x901A;&#x8FC7;&#x6307;&#x5B9A;&#x7684;&#x6587;&#x4EF6;&#x91CD;&#x65B0;&#x52A0;&#x8F7D;&#x914D;&#x7F6E;</li>
<li>&#x8BBE;&#x7F6E;&#x6307;&#x5B9A;&#x7684; logger &#x7684;&#x7EA7;&#x522B;&#x3002;&#x60F3;&#x8981;&#x8BBE;&#x7F6E;&#x4E3A; null&#xFF0C;&#x4F20;&#x9012; &quot;null&quot; &#x5B57;&#x7B26;&#x4E32;&#x5C31;&#x53EF;&#x4EE5;</li>
<li>&#x83B7;&#x53D6;&#x6307;&#x5B9A; logger &#x7684;&#x7EA7;&#x522B;&#x3002;&#x8FD4;&#x56DE;&#x503C;&#x53EF;&#x4EE5;&#x4E3A; null</li>
<li>&#x6216;&#x8005;&#x6307;&#x5B9A; logger &#x7684;<a href="https://github.com/Volong/logback-chinese-manual/blob/master/02%E7%AC%AC%E4%BA%8C%E7%AB%A0%EF%BC%9A%E6%9E%B6%E6%9E%84.md#%E6%9C%89%E6%95%88%E7%AD%89%E7%BA%A7%E5%8F%88%E7%A7%B0%E4%B8%BA%E7%AD%89%E7%BA%A7%E7%BB%A7%E6%89%BF" target="_blank">&#x6709;&#x6548;&#x7EA7;&#x522B;</a></li>
</ul>
<p><code>JMXConfigurator</code> &#x5C06;&#x5DF2;&#x7ECF;&#x5B58;&#x5728;&#x7684; logger &#x4EE5;&#x53CA;&#x72B6;&#x6001;&#x5F53;&#x4F5C;&#x5C5E;&#x6027;&#x8FDB;&#x884C;&#x5C55;&#x793A;&#x3002;</p>
<p>&#x8FD9;&#x4E2A;&#x72B6;&#x6001;&#x5217;&#x8868;&#x53EF;&#x4EE5;&#x5E2E;&#x52A9;&#x4F60;&#x8BCA;&#x65AD; logger &#x7684;&#x5185;&#x90E8;&#x72B6;&#x6001;&#x3002;</p>
<p><img src="images/statusList.gif" alt=""></p>
<h3 id="&#x907F;&#x514D;&#x5185;&#x5B58;&#x6CC4;&#x6F0F;">&#x907F;&#x514D;&#x5185;&#x5B58;&#x6CC4;&#x6F0F;</h3>
<p>&#x5982;&#x679C;&#x4F60;&#x7684;&#x5E94;&#x7528;&#x90E8;&#x7F72;&#x5728; web &#x670D;&#x52A1;&#x5668;&#x6216;&#x8005;&#x5E94;&#x7528;&#x670D;&#x52A1;&#x5668;&#x4E0A;&#xFF0C;&#x6CE8;&#x518C;&#x7684; <code>JMXConfigurator</code> &#x5B9E;&#x4F8B;&#x4F1A;&#x4ECE;&#x7CFB;&#x7EDF;&#x7C7B;&#x52A0;&#x8F7D;&#x5668;&#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x5F15;&#x7528;&#x5230;&#x4F60;&#x7684;&#x5E94;&#x7528;&#x4E2D;&#x3002;&#x5728;&#x5E94;&#x7528;&#x505C;&#x6B62;&#x6216;&#x8005;&#x91CD;&#x65B0;&#x90E8;&#x7F72;&#x4E8B;&#xFF0C;&#x5B83;&#x4F1A;&#x963B;&#x6B62;&#x5783;&#x573E;&#x56DE;&#x6536;&#xFF0C;&#x90A3;&#x4E48;&#x5C06;&#x4F1A;&#x5BFC;&#x81F4;&#x5185;&#x5B58;&#x6CC4;&#x6F0F;&#x3002;</p>
<p>&#x56E0;&#x6B64;&#xFF0C;&#x9664;&#x975E;&#x4F60;&#x7684;&#x5E94;&#x7528;&#x662F;&#x5355;&#x673A;&#x7684; Java &#x5E94;&#x7528;&#xFF0C;&#x5426;&#x5219;&#x7684;&#x8BDD;&#xFF0C;&#x4F60;&#x5FC5;&#x987B;&#x4ECE; JVM &#x7684; Mbeans &#x670D;&#x52A1;&#x4E0A;&#x6CE8;&#x9500; <code>JMXConfigurator</code> &#x5B9E;&#x4F8B;&#x3002;&#x901A;&#x8FC7; <code>LoggerContext</code> &#x8C03;&#x7528; <code>reset()</code> &#x65B9;&#x6CD5;&#x5C06;&#x4F1A;&#x81EA;&#x52A8;&#x6CE8;&#x9500;&#x4EFB;&#x4F55; JMXConfigurator &#x5B9E;&#x4F8B;&#x3002;&#x4E00;&#x4E2A;&#x597D;&#x7684;&#x65B9;&#x6CD5;&#x53BB;&#x91CD;&#x7F6E; logger &#x4E0A;&#x4E0B;&#x6587;&#x662F;&#x901A;&#x8FC7; <code>javax.servlet.ServletContextListener</code> &#x4E2D;&#x7684; <code>contextDestroyed()</code> &#x65B9;&#x6CD5;&#x3002;&#x793A;&#x4F8B;&#x4EE3;&#x7801;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre><code class="lang-java"><span class="hljs-keyword">import</span> javax.servlet.ServletContextEvent;
<span class="hljs-keyword">import</span> javax.servlet.ServletContextListener;

<span class="hljs-keyword">import</span> org.slf4j.LoggerFactory;
<span class="hljs-keyword">import</span> ch.qos.logback.classic.LoggerContext;

<span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MyContextListener</span> <span class="hljs-keyword">implements</span> <span class="hljs-title">ServletContextListener</span> </span>{

  <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">contextDestroyed</span><span class="hljs-params">(ServletContextEvent sce)</span> </span>{
    LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
    lc.stop();
  }

  <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">contextInitialized</span><span class="hljs-params">(ServletContextEvent sce)</span> </span>{
  }
}
</code></pre>
<h2 id="jmxconfigurator-&#x4E0E;&#x591A;&#x4E2A;-web-&#x5E94;&#x7528;"><code>JMXConfigurator</code> &#x4E0E;&#x591A;&#x4E2A; web &#x5E94;&#x7528;</h2>
<p>&#x5982;&#x679C;&#x4F60;&#x5728;&#x540C;&#x4E00;&#x4E2A;&#x670D;&#x52A1;&#x5668;&#x4E0A;&#x90E8;&#x7F72;&#x4E86;&#x591A;&#x4E2A; web &#x5E94;&#x7528;&#xFF0C;&#x5E76;&#x4E14;&#x4F60;&#x6CA1;&#x6709;&#x91CD;&#x5199;&#x9ED8;&#x8BA4;&#x7684;<a href="https://github.com/Volong/logback-chinese-manual/blob/master/09%E7%AC%AC%E4%B9%9D%E7%AB%A0%EF%BC%9A%E6%97%A5%E5%BF%97%E9%9A%94%E7%A6%BB.md#%E4%B8%8A%E4%B8%8B%E6%96%87%E9%80%89%E6%8B%A9%E5%99%A8" target="_blank">&#x4E0A;&#x4E0B;&#x6587;&#x9009;&#x62E9;&#x5668;</a>&#xFF0C;&#x4EE5;&#x53CA;&#x4F60;&#x628A; <em>logback-\</em>.jar<em> &#x4E0E; </em>slf4j-api.jar<em> &#x653E;&#x5230;&#x4E86;&#x6BCF;&#x4E2A; web &#x5E94;&#x7528;&#x7684; </em>WEB-INF/lib* &#x6587;&#x4EF6;&#x5939;&#x4E0B;&#x3002;&#x4E4B;&#x540E;&#x9ED8;&#x8BA4;&#x6BCF;&#x4E2A; <code>JMXConfigurator</code> &#x5B9E;&#x4F8B;&#x5C06;&#x4F1A;&#x6CE8;&#x518C;&#x5728;&#x540C;&#x4E00;&#x4E2A;&#x540D;&#x5B57;&#x4E0B;&#x3002;&#x4E5F;&#x5C31;&#x662F; &quot;ch.qos.logback.classic:Name=default,Type=ch.qos.logback.classic.jmx.JMXConfigurator&quot; &#x3002;&#x6362;&#x53E5;&#x8BDD;&#x8BF4;&#xFF0C;&#x5728;&#x4F60;&#x6BCF;&#x4E2A; web &#x5E94;&#x7528;&#x4E2D;&#xFF0C;&#x9ED8;&#x8BA4;&#x5404;&#x79CD; <code>JMXConfigurator</code> &#x5B9E;&#x4F8B;&#x5173;&#x8054;&#x7684; logger &#x4E0A;&#x4E0B;&#x6587;&#x5C06;&#x4F1A;&#x51B2;&#x7A81;&#x3002;</p>
<p>&#x4E3A;&#x4E86;&#x907F;&#x514D;&#x8FD9;&#x79CD;&#x4E0D;&#x5FC5;&#x8981;&#x7684;&#x51B2;&#x7A81;&#xFF0C;&#x4F60;&#x4EC5;&#x4EC5;&#x9700;&#x8981;<a href="https://github.com/Volong/logback-chinese-manual/blob/master/03%E7%AC%AC%E4%B8%89%E7%AB%A0%EF%BC%9Alogback%20%E7%9A%84%E9%85%8D%E7%BD%AE.md#%E8%AE%BE%E7%BD%AE-context-%E7%9A%84%E5%90%8D%E5%AD%97" target="_blank">&#x8BBE;&#x7F6E;&#x5E94;&#x7528;&#x7684;&#x65E5;&#x5FD7;&#x4E0A;&#x4E0B;&#x6587;</a>&#xFF0C;<code>JMXConfigurator</code> &#x5C06;&#x4F1A;&#x81EA;&#x52A8;&#x4F7F;&#x7528;&#x4F60;&#x8BBE;&#x7F6E;&#x597D;&#x7684;&#x540D;&#x5B57;&#x3002;</p>
<p>&#x4F8B;&#x5982;&#xFF0C;&#x5982;&#x679C;&#x90E8;&#x7F72;&#x4E24;&#x4E2A;&#x540D;&#x4E3A; &quot;Koala&quot; &#x4E0E; &quot;Wombat&quot; &#x7684; web &#x5E94;&#x7528;&#xFF0C;&#x90A3;&#x4E48;&#x4F60;&#x53EF;&#x4EE5;&#x5728; Koala &#x7684;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x4E2D;&#x8FD9;&#x6837;&#x5199;&#xFF1A;</p>
<pre><code class="lang-xml"><span class="hljs-tag">&lt;<span class="hljs-name">configuration</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">contextName</span>&gt;</span>Koala<span class="hljs-tag">&lt;/<span class="hljs-name">contextName</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">jmxConfigurator</span>/&gt;</span>
  ...
<span class="hljs-tag">&lt;<span class="hljs-name">configuration</span>&gt;</span>
</code></pre>
<p>&#x5728; Wombat &#x7684;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x4E2D;&#xFF0C;&#x4F60;&#x53EF;&#x4EE5;&#x8FD9;&#x6837;&#x5199;&#xFF1A;</p>
<pre><code class="lang-xml"><span class="hljs-tag">&lt;<span class="hljs-name">configuration</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">contextName</span>&gt;</span>Wombat<span class="hljs-tag">&lt;/<span class="hljs-name">contextName</span>&gt;</span>x
  <span class="hljs-tag">&lt;<span class="hljs-name">jmxConfigurator</span>/&gt;</span>
  ...
<span class="hljs-tag">&lt;<span class="hljs-name">configuration</span>&gt;</span>
</code></pre>
<p>&#x5728; jconsole &#x7684; MBeans &#x9762;&#x677F;&#x4E2D;&#xFF0C;&#x4F60;&#x53EF;&#x4EE5;&#x770B;&#x5230;&#x4E24;&#x4E2A;&#x4E0D;&#x540C;&#x7684; <code>JMXConfigurator</code> &#x5B9E;&#x4F8B;&#xFF1A;</p>
<p><img src="images/multiple.gif" alt=""></p>
<p>&#x901A;&#x8FC7; <jmxconfigurator> &#x5143;&#x7D20;&#x7684; &quot;objectName&quot; &#x5C5E;&#x6027;&#xFF0C;&#x4F60;&#x53EF;&#x4EE5;&#x5B8C;&#x5168;&#x63A7;&#x5236;&#x6CE8;&#x518C;&#x5230; MBeans &#x670D;&#x52A1;&#x4E2D; JMXConfigurator &#x7684;&#x540D;&#x5B57;&#x3002;</jmxconfigurator></p>
<h3 id="&#x5728;&#x670D;&#x52A1;&#x5668;&#x4E2D;&#x5F00;&#x542F;-jmx">&#x5728;&#x670D;&#x52A1;&#x5668;&#x4E2D;&#x5F00;&#x542F; JMX</h3>
<p>&#x5982;&#x679C;&#x4F60;&#x7684;&#x670D;&#x52A1;&#x5668;&#x8FD0;&#x884C;&#x5728; JDK 1.6 &#x6216;&#x8005;&#x66F4;&#x9AD8;&#x7248;&#x672C;&#xFF0C;&#x90A3;&#x4E48; JMX &#x9ED8;&#x8BA4;&#x5F00;&#x542F;&#x3002;</p>
<p>&#x5BF9;&#x4E8E;&#x65E7;&#x7248;&#x7684; JVM&#xFF0C;&#x6211;&#x4EEC;&#x5EFA;&#x8BAE;&#x4F60;&#x53C2;&#x8003;&#x4F60;&#x6240;&#x4F7F;&#x7528;&#x7684; web &#x670D;&#x52A1;&#x5668;&#x4E0A; JMX &#x76F8;&#x5173;&#x7684;&#x6587;&#x6863;&#x3002;&#x8FD9;&#x4E9B;&#x6587;&#x6863;&#x5728; <a href="http://tomcat.apache.org/tomcat-6.0-doc/monitoring.html" target="_blank">Tomcat</a> &#x4EE5;&#x53CA; <a href="http://docs.codehaus.org/display/JETTY/JMX" target="_blank">Jetty</a> &#x4E2D;&#x90FD;&#x53EF;&#x4EE5;&#x83B7;&#x5F97;&#x3002;&#x5728;&#x8FD9;&#x4E2A;&#x6587;&#x6863;&#x4E2D;&#xFF0C;&#x6211;&#x4EEC;&#x5C06;&#x4F1A;&#x8BE6;&#x7EC6;&#x53D9;&#x8FF0; Tomcat &#x4E0E; Jetty &#x76F8;&#x5173;&#x7684;&#x914D;&#x7F6E;&#x6B65;&#x9AA4;&#x3002;</p>
<h4 id="&#x5728;-jetty-&#x4E2D;&#x5F00;&#x542F;-jmx-&#x5728;-jdk-15-&#x4EE5;&#x53CA;-jdk-16-&#x6D4B;&#x8BD5;&#x8FC7;">&#x5728; Jetty &#x4E2D;&#x5F00;&#x542F; JMX (&#x5728; JDK 1.5 &#x4EE5;&#x53CA; JDK 1.6 &#x6D4B;&#x8BD5;&#x8FC7;)</h4>
<p>&#x63A5;&#x4E0B;&#x6765;&#x7684;&#x5DF2;&#x7ECF;&#x5728; JDK 1.5 &#x53CA; 1.6 &#x4E2D;&#x6D4B;&#x8BD5;&#x8FC7;&#x3002;&#x5728; JDK 1.6 &#x4EE5;&#x53CA;&#x4EE5;&#x540E;&#x7684;&#x7248;&#x672C;&#x4E2D;&#xFF0C;&#x4F60;&#x7684;&#x670D;&#x52A1;&#x5668;&#x662F;&#x9ED8;&#x8BA4;&#x5F00;&#x542F; JMX &#x7684;&#xFF0C;&#x4F60;&#x53EF;&#x4EE5;&#x4F46;&#x662F;&#x4E0D;&#x9700;&#x8981;&#x9075;&#x5FAA;&#x4E0B;&#x9762;&#x6240;&#x8BA8;&#x8BBA;&#x7684;&#x3002;&#x5728; JDK 1.5 &#x4E0B;&#xFF0C;&#x6DFB;&#x52A0; JMX &#x652F;&#x6301;&#xFF0C;&#x53EA;&#x9700;&#x8981;&#x5728; <em>$JETTY_HOME/etc/jetty.xml</em> &#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x4E2D;&#x6DFB;&#x52A0;&#x4E00;&#x4E2A;&#x989D;&#x5916;&#x7684;&#x652F;&#x6301;&#x3002;&#x4E0B;&#x9762;&#x662F;&#x9700;&#x8981;&#x88AB;&#x6DFB;&#x52A0;&#x7684;&#x5143;&#x7D20;&#xFF1A;</p>
<pre><code class="lang-xml"><span class="hljs-tag">&lt;<span class="hljs-name">Call</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;MBeanServer&quot;</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;java.lang.management.ManagementFactory&quot;</span> 
      <span class="hljs-attr">name</span>=<span class="hljs-string">&quot;getPlatformMBeanServer&quot;</span>/&gt;</span>

<span class="hljs-tag">&lt;<span class="hljs-name">Get</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;Container&quot;</span> <span class="hljs-attr">name</span>=<span class="hljs-string">&quot;container&quot;</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">Call</span> <span class="hljs-attr">name</span>=<span class="hljs-string">&quot;addEventListener&quot;</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">Arg</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">New</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;org.mortbay.management.MBeanContainer&quot;</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">Arg</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">Ref</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;MBeanServer&quot;</span>/&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">Arg</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">Call</span> <span class="hljs-attr">name</span>=<span class="hljs-string">&quot;start&quot;</span> /&gt;</span>
      <span class="hljs-tag">&lt;/<span class="hljs-name">New</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">Arg</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">Call</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">Get</span>&gt;</span>
</code></pre>
<p>&#x5982;&#x679C;&#x4F60;&#x60F3;&#x901A;&#x8FC7; <code>jconsole</code> &#x8BBF;&#x95EE; Jetty &#x4E2D;&#x7684; MBeans&#xFF0C;&#x90A3;&#x4E48;&#x4F60;&#x9700;&#x8981;&#x5728;&#x542F;&#x52A8; Jetty &#x524D;&#x8BBE;&#x7F6E;&#x7CFB;&#x7EDF;&#x5C5E;&#x6027; &quot;com.sun.management.jmxremote&quot;&#x3002;</p>
<p>&#x5BF9;&#x4E8E;&#x5355;&#x673A;&#x7248;&#x672C;&#x7684; Jetty&#xFF0C;&#x901A;&#x8FC7;&#xFF1A;</p>
<pre><code class="lang-java">java -Dcom.sun.management.jmxremote -jar start.jar [config files]
</code></pre>
<p>&#x5982;&#x679C;&#x4F60;&#x60F3;&#x5C06; Jetty &#x4F5C;&#x4E3A; Maven &#x63D2;&#x4EF6;&#x542F;&#x52A8;&#xFF0C;&#x90A3;&#x4E48;&#x4F60;&#x9700;&#x8981;&#x901A;&#x8FC7; <code>MAVEN_OPTS</code> shell &#x53D8;&#x91CF;&#x8BBE;&#x7F6E;&#x7CFB;&#x7EDF;&#x5C5E;&#x6027; &quot;com.sun.management.jmxremote&quot;&#xFF1A;</p>
<pre><code class="lang-java">MAVEN_OPTS=<span class="hljs-string">&quot;-Dcom.sun.management.jmxremote&quot;</span>
mvn jetty:run
</code></pre>
<p>&#x4F60;&#x53EF;&#x4EE5;&#x901A;&#x8FC7; <code>jconsole</code> &#x8BBF;&#x95EE; Jetty &#x7684; MBeans &#x4EE5;&#x53CA; logback &#x7684; <code>JMXConfigurator</code>&#x3002;</p>
<p><img src="images/jconsole15_jetty.gif" alt=""></p>
<p>&#x5728;&#x4F60;&#x8FDE;&#x63A5;&#x4E0A;&#x4EE5;&#x540E;&#xFF0C;&#x4F60;&#x53EF;&#x4EE5;&#x8BBF;&#x95EE; <code>JMXConfigurator</code>&#xFF0C;&#x5C31;&#x50CF;&#x4E0A;&#x9762;&#x7684;<a href="https://github.com/Volong/logback-chinese-manual/blob/master/10%E7%AC%AC%E5%8D%81%E7%AB%A0%EF%BC%9AJMX%20%E9%85%8D%E7%BD%AE%E5%99%A8.md#%E5%9C%A8-jconsole-%E4%B8%AD%E6%9F%A5%E7%9C%8B-jmxconfigurator-%E7%9A%84%E6%88%AA%E5%9B%BE" target="_blank">&#x622A;&#x56FE;</a>&#x4E00;&#x6837;&#x3002;</p>
<h4 id="mx4j-&#x4E0E;-jetty-&#x5728;-jdk-15-&#x4EE5;&#x53CA;-16-&#x6D4B;&#x8BD5;&#x8FC7;">MX4j &#x4E0E; Jetty (&#x5728; JDK 1.5 &#x4EE5;&#x53CA; 1.6 &#x6D4B;&#x8BD5;&#x8FC7;)</h4>
<p>&#x5047;&#x8BBE;&#x4F60;&#x5DF2;&#x7ECF;&#x4E0B;&#x8F7D;&#x4E86; <a href="http://mx4j.sourceforge.net/" target="_blank">MX4J</a>&#xFF0C;&#x4F60;&#x60F3;&#x8981;&#x901A;&#x8FC7; MX4J &#x7684; HTTP &#x63A5;&#x53E3;&#x8BBF;&#x95EE; <code>JMXConfigurator</code>&#xFF0C;&#x4F60;&#x9700;&#x8981;&#x6DFB;&#x52A0;&#x4E4B;&#x524D;&#x8BA8;&#x8BBA;&#x8FC7;&#x7684;&#x914D;&#x7F6E;&#xFF0C;&#x5E76;&#x4E14;&#x8BBE;&#x7F6E; managementPort&#x3002;</p>
<pre><code class="lang-xml"><span class="hljs-tag">&lt;<span class="hljs-name">Call</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;MBeanServer&quot;</span>
    <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;java.lang.management.ManagementFactory&quot;</span>
    <span class="hljs-attr">name</span>=<span class="hljs-string">&quot;getPlatformMBeanServer&quot;</span>/&gt;</span>

<span class="hljs-tag">&lt;<span class="hljs-name">Get</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;Container&quot;</span> <span class="hljs-attr">name</span>=<span class="hljs-string">&quot;container&quot;</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">Call</span> <span class="hljs-attr">name</span>=<span class="hljs-string">&quot;addEventListener&quot;</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">Arg</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">New</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;org.mortbay.management.MBeanContainer&quot;</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">Arg</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">Ref</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;MBeanServer&quot;</span>/&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">Arg</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">Set</span> <span class="hljs-attr">name</span>=<span class="hljs-string">&quot;managementPort&quot;</span>&gt;</span>8082<span class="hljs-tag">&lt;/<span class="hljs-name">Set</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">Call</span> <span class="hljs-attr">name</span>=<span class="hljs-string">&quot;start&quot;</span> /&gt;</span>
      <span class="hljs-tag">&lt;/<span class="hljs-name">New</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">Arg</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">Call</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">Get</span>&gt;</span>
</code></pre>
<p>&#x800C;&#x4E14;&#xFF0C;<em>mx4j-tools.jar</em> &#x9700;&#x8981;&#x6DFB;&#x52A0;&#x5230; Jetty &#x7684;&#x7C7B;&#x8DEF;&#x5F84;&#x4E0B;&#x3002;</p>
<p>&#x5982;&#x679C;&#x4F60;&#x60F3;&#x5C06; Jetty &#x4F5C;&#x4E3A; Maven &#x7684;&#x63D2;&#x4EF6;&#x8FD0;&#x884C;&#xFF0C;&#x90A3;&#x4E48;&#x4F60;&#x9700;&#x8981;&#x6DFB;&#x52A0; <em>mx4j-tools</em> &#x4F5C;&#x4E3A;&#x4F9D;&#x8D56;&#x3002;</p>
<pre><code class="lang-xml"><span class="hljs-tag">&lt;<span class="hljs-name">plugin</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">groupId</span>&gt;</span>org.mortbay.jetty<span class="hljs-tag">&lt;/<span class="hljs-name">groupId</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">artifactId</span>&gt;</span>maven-jetty-plugin<span class="hljs-tag">&lt;/<span class="hljs-name">artifactId</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">configuration</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">jettyConfig</span>&gt;</span>path/to/jetty.xml<span class="hljs-tag">&lt;/<span class="hljs-name">jettyConfig</span>&gt;</span>
    ...
  <span class="hljs-tag">&lt;/<span class="hljs-name">configuration</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">dependencies</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">dependency</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">groupId</span>&gt;</span>mx4j<span class="hljs-tag">&lt;/<span class="hljs-name">groupId</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">artifactId</span>&gt;</span>mx4j-tools<span class="hljs-tag">&lt;/<span class="hljs-name">artifactId</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">version</span>&gt;</span>3.0.1<span class="hljs-tag">&lt;/<span class="hljs-name">version</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">dependency</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">dependencies</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">plugin</span>&gt;</span>
</code></pre>
<p>&#x5728;&#x901A;&#x8FC7;&#x4EE5;&#x4E0A;&#x914D;&#x7F6E;&#x542F;&#x52A8;&#x4E86; Jetty &#x4E4B;&#x540E;&#xFF0C;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x5982;&#x4E0B;&#x7684; URL &#x8BBF;&#x95EE; <code>JMXConfigurator</code> (&#x67E5;&#x627E; &quot;ch.qos.logback.classic&quot;)&#xFF1A;</p>
<pre><code class="lang-http">http://localhost:8082/
</code></pre>
<p>&#x4E0B;&#x9762;&#x662F;&#x901A;&#x8FC7; MX4J &#x63A5;&#x53E3;&#x8BBF;&#x95EE;&#x7684;&#x622A;&#x56FE;&#x4FE1;&#x606F;&#xFF1A;</p>
<p><img src="images/mx4j_jetty.gif" alt=""></p>
<h4 id="&#x5728;-tomcat-&#x914D;&#x7F6E;-jmx-&#x5728;-jdk-15-&#x4EE5;&#x53CA;-16-&#x6D4B;&#x8BD5;&#x8FC7;">&#x5728; Tomcat &#x914D;&#x7F6E; JMX (&#x5728; JDK 1.5 &#x4EE5;&#x53CA; 1.6 &#x6D4B;&#x8BD5;&#x8FC7;)</h4>
<p>&#x5982;&#x679C;&#x4F60;&#x4F7F;&#x7528; JDK 1.6 &#x4EE5;&#x53CA;&#x4EE5;&#x540E;&#x7684;&#x7248;&#x672C;&#xFF0C;&#x4F60;&#x7684;&#x670D;&#x52A1;&#x5668;&#x662F;&#x9ED8;&#x8BA4;&#x5F00;&#x542F; JMX &#x7684;&#xFF0C;&#x4F60;&#x53EF;&#x4EE5;&#x4F46;&#x662F;&#x4E0D;&#x9700;&#x8981;&#x9075;&#x5FAA;&#x4E0B;&#x9762;&#x6240;&#x8BA8;&#x8BBA;&#x7684;&#x3002;&#x5728; JDK 1.5 &#x4E0B;&#xFF0C;&#x9700;&#x8981;&#x5728; Tomcat &#x7684; <em>$TOMCAT_HOME/bin/catalina.bat/sh</em> shell &#x811A;&#x672C;&#x4E2D;&#x6DFB;&#x52A0;&#x5982;&#x4E0B;&#x7684;&#x884C;&#xFF1A;</p>
<pre><code class="lang-shell">CATALINA_OPTS=&quot;-Dcom.sun.management.jmxremote&quot;
</code></pre>
<p>&#x4E00;&#x65E6;&#x901A;&#x8FC7;&#x8FD9;&#x4E9B;&#x914D;&#x7F6E;&#x542F;&#x52A8;&#x540E;&#xFF0C;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x5728;&#x547D;&#x4EE4;&#x884C;&#x8F93;&#x5165;&#x5982;&#x4E0B;&#x547D;&#x4EE4;&#x6765;&#x83B7;&#x53D6; Tomcat &#x7684; MBeans &#x4EE5;&#x53CA; logback &#x7684; <code>JMXConfigurator</code>&#xFF1A;</p>
<pre><code class="lang-shell">jconsole
</code></pre>
<p><img src="images/jconsole15_tomcat.gif" alt=""></p>
<p>&#x5728;&#x4F60;&#x8FDE;&#x63A5;&#x4E0A;&#x4EE5;&#x540E;&#xFF0C;&#x4F60;&#x53EF;&#x4EE5;&#x8BBF;&#x95EE; <code>JMXConfigurator</code>&#xFF0C;&#x5C31;&#x50CF;&#x4E0A;&#x9762;&#x7684;<a href="https://github.com/Volong/logback-chinese-manual/blob/master/10%E7%AC%AC%E5%8D%81%E7%AB%A0%EF%BC%9AJMX%20%E9%85%8D%E7%BD%AE%E5%99%A8.md#%E5%9C%A8-jconsole-%E4%B8%AD%E6%9F%A5%E7%9C%8B-jmxconfigurator-%E7%9A%84%E6%88%AA%E5%9B%BE" target="_blank">&#x622A;&#x56FE;</a>&#x4E00;&#x6837;&#x3002;</p>
<h4 id="mx4j-&#x4E0E;-tomcat-&#x5728;-jdk-15-&#x4EE5;&#x53CA;-16-&#x6D4B;&#x8BD5;&#x8FC7;">MX4J &#x4E0E; Tomcat (&#x5728; JDK 1.5 &#x4EE5;&#x53CA; 1.6 &#x6D4B;&#x8BD5;&#x8FC7;)</h4>
<p>&#x4F60;&#x53EF;&#x80FD;&#x60F3;&#x8981;&#x901A;&#x8FC7; MX4J &#x63D0;&#x4F9B;&#x7684; web &#x63A5;&#x53E3;&#x8BBF;&#x95EE; JMX &#x7EC4;&#x4EF6;&#x3002;&#x5728;&#x8FD9;&#x79CD;&#x60C5;&#x51B5;&#x4E0B;&#xFF0C;&#x4E0B;&#x9762;&#x662F;&#x5FC5;&#x987B;&#x7684;&#x6B65;&#x9AA4;&#xFF1A;</p>
<p>&#x5047;&#x8BBE;&#x4F60;&#x5DF2;&#x7ECF;&#x4E0B;&#x8F7D;&#x4E86; <a href="http://mx4j.sourceforge.net/" target="_blank">MX4J</a>&#xFF0C;&#x5C06; <em>mx4j-tools.jar</em> &#x6587;&#x4EF6;&#x653E;&#x5230;&#x4E86; <em>$TOMCAT_HOME/bin/</em> &#x6587;&#x4EF6;&#x5939;&#x4E0B;&#x3002;&#x90A3;&#x4E48;&#xFF0C;&#x6DFB;&#x52A0;&#x5982;&#x4E0B;&#x7684;&#x884C;&#x5230; <em>$TOMCAT_HOME/bin/catalina.sh</em> &#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x4E2D;&#xFF1A;</p>
<pre><code class="lang-shell">&lt;!-- at the beginning of the file --&gt;
CATALINA_OPTS=&quot;-Dcom.sun.management.jmxremote&quot;

&lt;!-- in the &quot;Add on extra jar files to CLASSPATH&quot; section --&gt;
CLASSPATH=&quot;$CLASSPATH&quot;:&quot;$CATALINA_HOME&quot;/bin/mx4j-tools.jar
</code></pre>
<p>&#x6700;&#x540E;&#xFF0C;&#x5728; <em>$TOMCAT_HOME/conf/server.xml</em> &#x6587;&#x4EF6;&#x4E2D;&#x58F0;&#x660E;&#x4E00;&#x4E2A;&#x65B0;&#x7684; <code>Connector</code>&#xFF1A;</p>
<pre><code class="lang-xml"><span class="hljs-tag">&lt;<span class="hljs-name">Connector</span> <span class="hljs-attr">port</span>=<span class="hljs-string">&quot;0&quot;</span> 
  <span class="hljs-attr">handler.list</span>=<span class="hljs-string">&quot;mx&quot;</span>
  <span class="hljs-attr">mx.enabled</span>=<span class="hljs-string">&quot;true&quot;</span> 
  <span class="hljs-attr">mx.httpHost</span>=<span class="hljs-string">&quot;localhost&quot;</span> 
  <span class="hljs-attr">mx.httpPort</span>=<span class="hljs-string">&quot;8082&quot;</span> 
  <span class="hljs-attr">protocol</span>=<span class="hljs-string">&quot;AJP/1.3&quot;</span> /&gt;</span>
</code></pre>
<p>&#x4E00;&#x65E6; Tomcat &#x542F;&#x52A8;&#x540E;&#xFF0C;&#x4F60;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x8BBF;&#x95EE;&#x5982;&#x4E0B;&#x7684; URL &#x627E;&#x5230; JMXConfigurator (&#x67E5;&#x627E; &quot;ch.qos.logback.classic&quot;)&#xFF1A;</p>
<p>&#x4E0B;&#x9762;&#x662F;&#x901A;&#x8FC7; MX4J &#x63A5;&#x53E3;&#x8BBF;&#x95EE;&#x5F97;&#x5230;&#x7684;&#x622A;&#x56FE;&#xFF1A;</p>
<p><img src="images/mx4j_tomcat.gif" alt=""></p>



                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="09第九章日志隔离.html" class="navigation navigation-prev " aria-label="Previous page: 第九章：日志隔离">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="11第十一章Joran.html" class="navigation navigation-next " aria-label="Next page: 第十一章：Joran">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"第十章：JMX 配置器","level":"1.11","depth":1,"next":{"title":"第十一章：Joran","level":"1.12","depth":1,"path":"11第十一章Joran.md","ref":"11第十一章Joran.md","articles":[]},"previous":{"title":"第九章：日志隔离","level":"1.10","depth":1,"path":"09第九章日志隔离.md","ref":"09第九章日志隔离.md","articles":[]},"dir":"ltr"},"config":{"plugins":["add-js-css","myseo"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"add-js-css":{"js":["./lib/site.js"]},"myseo":{"description":"logback中文网包含了logback中文文档，最新资讯，应用案例等。logback 继承自 log4j，它建立在有十年工业经验的日志系统之上。它比其它所有的日志系统更快并且更小，包含了许多独特并且有用的特性。","keywords":"logback中文文档, logback api文档, logback log4j,springboot logback,logback日志类型","titlePrefix":"logback中文网|"},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","keywords":"","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"logback中文手册","gitbook":"*","description":""},"file":{"path":"10第十章JMX配置器.md","mtime":"2019-02-23T10:29:01.000Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-02-24T03:19:05.191Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-add-js-css/fda70cfc36440304bb976a11f47eb151-site.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

